package com.core.constant;

import java.util.concurrent.TimeUnit;

import static com.core.constant.OtherConstants.DATA_RETENTION_DAYS;
import static com.core.constant.OtherConstants.MAX_DAYS_AHEAD;

public class RedisConstants {
    /**
     * 用户和登录模块
     */
    //用于保存用户信息
    public static final String LOGIN_USER_KEY = "login:studentId:";
    public static final Long LOGIN_USER_TTL = 36L;
    public static final TimeUnit LOGIN_USER_TIMEUNIT = TimeUnit.DAYS;

    //保存了所有用户id的set的key
    public static final String REGISTER_USER_ID_KEY = "user:id:all";

    //保存用户已经退出登录的jwttokwn
    public static final String USER_LOGOUT_TOKEN_KEY = "user:logout:token:all";
    //保存退出登录token的时间，和JwtUtil中的EXPIRATION保持一致
    public static final long USER_LOGOUT_TTL = 8640000L * 1000;

    // 保存黑名单用户
    public static final String USER_BLACKLIST_KEY = "user:blacklist:all";


    /**
     * 座位预约模块
     */

    // 保存教室当日剩余可用座位key：reservation:daily_classroom_availability:<classroomId>:<date>
    public static final String DAILY_CLASSROOM_AVAILABLE_SEATS_KEY = "classroom:available:seats:";
    // 教室当日剩余可用座位过期时间
    public static final Long DAILY_CLASSROOM_AVAILABLE_SEATS_TTL=(long)MAX_DAYS_AHEAD+DATA_RETENTION_DAYS;
    public static final TimeUnit DAILY_CLASSROOM_AVAILABLE_SEATS_TIMEUNIT = TimeUnit.DAYS;
    public static final String DAILY_CLASSROOM_AVAILABLE_SEATS_TTL_STRING_SEC= String.valueOf(8L*86400);


}
